package org.example.jiaxiao.controller;

import org.example.jiaxiao.service.GradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/grade")
public class GradeController {
    @Autowired
    private GradeService gradeService;

    @RequestMapping("/add")
    public int addGrade(@RequestParam("studentId") Integer studentId,
                        @RequestParam("examId") String examId) {
        return gradeService.addGrade(studentId, examId);
    }
}
